<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./JS/vue.js"></script>
</head>
<body>
    <div id="app">
        <my-cpn></my-cpn>
        <my-cpn></my-cpn>
    </div>
    <script>
        //ES6 `abc`
        //1、创建组件构造器对象
        const cpnc = Vue.extend({
            template: `
            <div>
                <h2>标题</h2>
                <p>内容</p>
                <p>内容</p>
                <p>内容</p>
                </div>
            `
        });
        //2、注册组件
        Vue.component('my-cpn',cpnc)
        const app = new Vue({
            el: '#app',
            data: {

            }
        })
    </script>
</body>
</html>